//index.js
Page({
    data: {
        list: [
            {
                id: 'widget',
                name: '请假信息',
                open: false,
                pages: [{   
                      zh:'申请成功',
                      url:"untreated/untreatedleg/leg"
                  },{
                      zh:'未审核',
                      url:"leg/leg"
                  }   
                      ]
            },
            {
                id: 'content',
                name: '创建请假条',
                open: false,
                pages: [{
                    zh:'学生请假条',
                    url:"news/news"
                }
                  ]
              }
        ]
    },
    kindToggle: function (e) {
        var id = e.currentTarget.id, list = this.data.list;
        for (var i = 0, len = list.length; i < len; ++i) {
            if (list[i].id == id) {
                list[i].open = !list[i].open
            } else {
                list[i].open = false
            }
        }
        this.setData({
            list: list
        });
    }
  });